From 2b6a4ba8907c82ba1844711606a3cf6292fe25e2 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 3 Oct 2014 06:48:18 +0200 Subject: [PATCH] gtk-demo: Remove useless code in colorsel example We have the color stored in a global variable already. There is absolutely no need to also force it into the CSS machinery. --- demos/gtk-demo/colorsel.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c index 73a9505ac6..8f0cc188c2 100644 --- a/demos/gtk-demo/colorsel.c +++ b/demos/gtk-demo/colorsel.c @@ -20,12 +20,7 @@ draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) { - GtkStyleContext *context; - GdkRGBA rgba; - - context = gtk_widget_get_style_context (widget); - gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &rgba); - gdk_cairo_set_source_rgba (cr, &rgba); + gdk_cairo_set_source_rgba (cr, &color); cairo_paint (cr); return TRUE; @@ -39,7 +34,6 @@ response_cb (GtkDialog *dialog, if (response_id == GTK_RESPONSE_OK) { gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color); - gtk_widget_override_background_color (da, 0, &color); } gtk_widget_destroy (GTK_WIDGET (dialog)); @@ -105,8 +99,6 @@ do_colorsel (GtkWidget *do_widget) /* set a minimum size */ gtk_widget_set_size_request (da, 200, 200); - /* set the color */ - gtk_widget_override_background_color (da, 0, &color); gtk_container_add (GTK_CONTAINER (frame), da); -- 2.30.2